package com.smartshopping.model;

import android.os.Parcel;
import android.os.Parcelable;

public class Item implements Parcelable{
	private int id;
	private String name;
	private int typeId;
	private int amount = 1;
	private int price;
	
	public Item(int id, String name, int typeID) {
		super();
		this.id = id;
		this.name = name;
		this.typeId = typeID;
	}
	
	public Item(int id, String name,int typeID, int amount, int price) {
		super();
		this.id = id;
		this.name = name;
		this.amount = amount;
		this.price = price;
	}
	
	
	public int getPrice() {
		return price;
	}

	public int getId() 
	{
		return id;
	}
	public String getName() 
	{
		return name;
	}
	public int getTypeId() 
	{
		return typeId;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	//Add for object given adtivity, user
	
	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int arg1) {
		dest.writeInt(this.id);
        dest.writeString(this.name);
        dest.writeInt(this.typeId);
        dest.writeInt(this.amount);
        dest.writeInt(this.price);
	}
	
	public Item(Parcel source) {
        // TODO Auto-generated method stub
        this.id = source.readInt();
        this.name = source.readString();
        this.typeId = source.readInt();
        this.amount = source.readInt();
        this.price = source.readInt();
    }
 
    public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
 
        @Override
        public Item createFromParcel(Parcel source) {
            // TODO Auto-generated method stub
            return new Item(source);
        }
 
        @Override
        public Item[] newArray(int size) {
            // TODO Auto-generated method stub
            return new Item[size];
        }
    };
	
}
